#pragma once

#include <QGLWidget>
#include <QQuaternion>

class CoordDrawer : public QGLWidget
{
	Q_OBJECT

public:
	CoordDrawer(QWidget *parent);
	CoordDrawer(const QGLFormat &fmt, QWidget *parent, int mode);

public slots:
	void setStabilization(const QQuaternion &q);
	void setQuat(const QQuaternion &q);
	void setMode(int index);

protected:
	void initializeGL();
	void resizeGL(int w, int h);
	void paintGL();

	void drawScene(GLenum buffer);
	void drawArrow();
	void drawCoord(const QQuaternion &q, float alpha);

	QQuaternion _stabilization;
	QQuaternion _quat;
	int _mode;
};
